<style type="text/css">
	/* --- 取消数字输入框后面上下箭头 --- */

	.noArrow::-webkit-outer-spin-button,
	.noArrow::-webkit-inner-spin-button {
		-webkit-appearance: none;
		margin: 0;
	}

	.noArrow {
		-moz-appearance: textfield;
	}
</style>
<div class="wrapper-md ng-scope">
	<div class="row">
		<!-- <div class="panel panel-default">
			<div class="panel-body">
				<div class="col-xs-12">
					<div class="col-xs-10 input-group">
						<p class="form-control" ng-bind="href" style="background-color:#e7e7e7"></p>
						<input id="textForCopy" class="form-control" ng-model="href" style="height: 0px; padding: 0px; border-width: 0px;" />
						<a class="btn btn-default btn-block input-group-addon" ng-click="goRegister()">复制</a>
					</div>
				</div>
			</div>
		</div> -->
		<div class="panel panel-default">
			<div class="panel-body mt10">
				<tabset class="tab-container">

					<tab heading="机构列表" active="status.active" ng-click="cancel()">
						<div class="panel-body">
							<table id="treetable" class="table table-striped table-bordered dataTable table-condensed tree_table" style="display: none;">
								<thead>
									<tr>
										<th class="col-md-2 text-center">机构名称</th>
										<th class="col-md-1 text-center">机构编码</th>
										<th class="col-md-1 text-center">备注</th>
										<th class="col-md-1 text-center">操作</th>
									</tr>
								</thead>
								<tbody>
									<tr ng-repeat="office in office_list" id="{{office.id}}" pid="{{office.parent_id}}" sort="{{office.sort}}" officeloadover>
										<td>
											<a href ng-click="update(office)" style="color:#2fa4e7">{{office.name}}</a>
										</td>
										<td class="text-center">{{office.code}}</td>
										<td class="text-center">{{office.remarks}}</td>
										<td>
											<div ng-if="office.flag == 1">
												<button type="button" class="btn btn-info btn-xs" ng-click="update(office)">修改</button>
												<!-- <button type="button" ng-class="{true: 'btn btn-success btn-xs', false: 'btn btn-danger btn-xs'}[office.USEABLE == 0]"
                         ng-click="openANDstop(office)">{{office.USEABLE == 0?'开启':'停用'}}</button>  -->
											</div>
										</td>
									</tr>
								</tbody>
							</table>
						</div>
					</tab>

					<tab heading={{tabname.name}} ng-click="add(office_list[0])" active="tabname.active">
						<div class="panel-body">
							<form name="form1" class="form-horizontal ng-pristine ng-valid-required">
								<div class="form-group" ng-if="status.addSub">
									<label class="col-lg-2 control-label">上级机构:</label>
									<div class="col-lg-4">
										<input type="text" class="form-control" ng-model="obj.super_name" ng-disabled="true">
									</div>
								</div>
								<div class="form-group">
									<label class="col-lg-2 control-label">机构名称:</label>
									<div class="col-lg-4">
										<input type="text" class="form-control" ng-model="obj.name" placeholder='必填'>
									</div>
								</div>
								<!-- <div class="form-group">
									<label class="col-lg-2 control-label">归属区域:</label>
									<div class="col-lg-4">
										<ui-select ng-model="obj.area_id" theme="bootstrap">
											<ui-select-match placeholder="选择区域..">{{$select.selected.name}}</ui-select-match>
											<ui-select-choices repeat="item.id as item in cityList | filter: $select.search">
												<span ng-bind-html="item.name | highlight: $select.search"></span>
											</ui-select-choices>
										</ui-select>
									</div>
								</div> -->
								<div class="form-group">
									<label class="col-lg-2 control-label">标识信息:</label>
									<div class="col-lg-4">
										<ui-select ng-model="obj.zip_code" theme="bootstrap">
											<ui-select-match placeholder="选择标识..">{{$select.selected.name}}</ui-select-match>
											<ui-select-choices repeat="item.value as item in siteList">
												<span ng-bind-html="item.name | highlight: $select.search"></span>
											</ui-select-choices>
										</ui-select>
									</div>
								</div>
								<!-- 修改机构时显示 -->
								<div ng-if="!status.addSub">
									<div class="form-group">
										<label class="col-lg-2 control-label">手机号:</label>
										<div class="col-lg-4">
											<input type="text" class="form-control" ng-model="obj.phone">
										</div>
									</div>
									<div class="form-group">
										<label class="col-lg-2 control-label">负责人:</label>
										<div class="col-lg-4">
											<input type="text" class="form-control" ng-model="obj.master">
										</div>
									</div>
									<div class="form-group">
										<label class="col-lg-2 control-label">联系地址:</label>
										<div class="col-lg-4">
											<input type="text" class="form-control" ng-model="obj.address">
										</div>
									</div>
								</div>
								<div class="form-group">
									<label class="col-lg-2 control-label">备注信息:</label>
									<div class="col-lg-4">
										<textarea class="form-control" rows="3" ng-model="obj.remarks"></textarea>
									</div>
								</div>
								<div ng-show="status.addSub">
									<div class="form-group">
										<div class="col-lg-8 col-lg-offset-2">
											<i>添加默认的同名登录用户，初始密码:000000。</i>
										</div>
									</div>
								</div>

							</form>
							<div class="col-lg-2"></div>
							<div class="col-lg-4">
								<button class="btn btn-primary btn-rounded" ng-click="save()">保存</button>
								<button class="btn btn-default btn-rounded" ng-click="cancel()">取消</button>
							</div>
						</div>
					</tab>

				</tabset>
			</div>
		</div>

	</div>
</div>